home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Languages / MPW Oberon 2.1168 / OInterfaces / Unmangler.mod < prev    next >
Encoding:
Text File  |  1995-08-10  |  2.3 KB  |  51 lines  |  [TEXT/MPS ]

  1. (*---------------------------------------------------------------------------*
  2.  |                                                                           |
  3.  |                            <<< Unmangler.p >>>                            |
  4.  |                                                                           |
  5.  |                         C++ Function Name Decoding                        |
  6.  |                                                                           |
  7.  |                 Copyright Apple Computer, Inc. 1988-1995                  |
  8.  |                           All rights reserved.                            |
  9.  |                                                                           |
  10.  *---------------------------------------------------------------------------*)
  11.  
  12. (*$TAGS-*)
  13. (*$CALLING PASCAL*)
  14. MODULE Unmangler;
  15.  
  16. IMPORT SYSTEM, Types;
  17.  
  18.         (*
  19.         PROCEDURE unmangle*(dst: UNIV Types.Ptr; src: UNIV Types.Ptr; limit: LongInt): LongInt; C;
  20.             (*This function unmangles C++ mangled symbols (i.e. a symbol with a type signature).
  21.              The mangled C string is passed in “src” and the unmangled C string is returned in
  22.              “dst”.  Up to “limit” characters (not including terminating null) may be retured
  23.              in “dst”.
  24.          
  25.              The function returns,
  26.          
  27.                  -1 ==> error, probably because symbol was not mangled, but looked like it was
  28.                     0 ==> symbol wasn't mangled; not copied either
  29.                     1 ==> symbol was mangled; unmangled result fit in buffer
  30.                     2 ==> symbol was mangled; unmangled result truncated to fit in buffer*)
  31.         *)
  32.         
  33.         PROCEDURE Unmangle*(dst: (*ΔΔUNIVΔΔ*) Types.StringPtr; src: (*ΔΔUNIVΔΔ*) Types.StringPtr; limit: LONGINT): LONGINT;
  34.             (*This function unmangles C++ mangled symbols (i.e. a symbol with a type signature).
  35.              The mangled Pascal string is passed in “src” and the unmangled Pascal string is
  36.              returned in “dst”.  Up to “limit” characters may be retured in “dst”.
  37.             
  38.              The function returns,
  39.              
  40.                  -1 ==> error, probably because symbol was not mangled, but looked like it was
  41.                     0 ==> symbol wasn't mangled; not copied either
  42.                     1 ==> symbol was mangled; unmangled result fit in buffer
  43.                     2 ==> symbol was mangled; unmangled result truncated to fit in buffer
  44.                      
  45.              This function is identical to unmangle() above except that all the strings are
  46.              Pascal instead of C strings.
  47.             *)
  48.             EXTERNAL PASCAL;
  49.  
  50.  END Unmangler.
  51.